package test;

import java.util.Scanner;
import java.util.TreeSet;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

/**
 * @author 郝文雪
 * @date 2022/9/21 19:43
 * @Description Test
 */
public class cvte2 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        String str=sc.nextLine();
        String[] arr=str.split(",");
        int[] array=new int[arr.length];
        for (int i = 0; i < arr.length; i++) {
            array[i]=Integer.parseInt(arr[i]);
        }
        for (int i = 0; i < array.length; i++) {
            if(array[i]==0){
                for (int j = i+1; j < array.length; j++) {
                    array[j-1]=array[j];
                }
                array[array.length-1]=0;
            }
        }
        System.out.printf("[");
        for (int i = 0; i < array.length; i++) {
            if(i==array.length-1){
                System.out.printf("%d",array[i]);
            }else{
                System.out.printf("%d",array[i]);
                System.out.printf(",");
            }
        }
        System.out.printf("]");
    }
}
